function [phi, delta, Sigma_trend, Sigma_epsilon, rho, Sigma_v, lambda, Q_alpha_eps, Q_sigma_eps, Q_sigma_v] = InitialConditions_Extended(T,n,p_final,k,trend,exog,prior_trend)


phi = zeros(1,p_final);          % VAR coefficients of factors

% Sigma_epsilon = 0.5*eye(nf);             % Variances of VAR innovations
% Sigma_epsilon(trend+1:end,trend+1:end) = 0.001*ones(nf-trend)+(1-0.001)*eye(nf-trend);             % Variances of VAR innovations

Sigma_epsilon = 0.1;             % Variances of VAR innovations


Sigma_trend = prior_trend*eye(trend);

Sigma_epsilon = repmat(Sigma_epsilon,[1,1,T-2]);
     


if ~isempty(exog)
delta = zeros(k,size(exog,2));
else
delta = zeros(k,1);
end
                                     
rho = zeros(n,2);  

Sigma_v = ones(n,T-2);

lambda = ones(n,(1+trend)*(5+1));


    r = 0;

    Q_alpha_eps = 1e-5*eye(r);
    Q_sigma_eps = 1e-5;
       
    Q_sigma_v = 1e-5*eye(n);

end

